'use strict';
exports.main = async (event, context) => {
    const { formData } = event;
    const db = uniCloud.database();
    const { result } = await db.collection('home-setting').get();
    if (result.data.length > 0) {
        await db.collection('home-setting').doc(result.data[0]._id).update(formData);
    } else {
        await db.collection('home-setting').add(formData);
    }
    return {
        success: true,
        message: '保存成功'
    };
};